<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonEdit.jsp"%>
<%@ include file="/commons/tabs.jsp"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>提交</title>
<script type="text/javascript" src="${ctx}/scripts/div/common.js"></script>
<script type="text/javascript" src="${ctx}/scripts/public.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common/prototype.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script type="text/javascript" src="${ctx }/scripts/public3.js"></script>
<script type="text/javascript" src="${ctx}/scripts/ajaxException.js"></script>

<script>

	function sumbitWin(){

		setButtonStatus(false);

		var tableObj = document.getElementById("ec_table");
		var trArray = tableObj.getElementsByTagName("tr");
		var firstIds = "";
		for(var i = 0; i < trArray.length; i++){
			firstIds += trArray[i].id+",";
		}
		var secondId = $('secondId').value;
		var requisitionId = $('requisitionId').value;
		var url = "${ctx}/renovation_renovateRequisitionAction.do?method=sumbitInfo";
		new Ajax.Request(url,
			         { method:'post',
					   parameters:{requisitionId:requisitionId,firstIds:firstIds,secondId:secondId},
					   onComplete:refleshClose
					 });
	}

	function refleshClose(response){
		setButtonStatus(true);

		ajaxSubmitException(response.responseText);

		findFrame('main').refleshRenReqFrame(); //刷新主页面列表
		windowClose();
	}

	function setButtonStatus(status){ //设置按钮状态 true 代表可用 false代表不可用
		$("btn1_22").disabled = !status;
		$("btn1_32").disabled = !status;
	}
</script>
</head>

<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="window_head_outBg"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><img src="${ctx}/images/ico_Advance.gif" width="16" height="16" align="absmiddle" /> <span class="window_head_intext">选择会签人</span></td>
        </tr>
    </table></td>
  </tr>
  <tr><td class="aux_header_line_1"></td></tr>
  <tr><td class="aux_header_line_2"></td></tr>
  <tr>
    <td class="content">

	<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="aux_outtable_color">
        <table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color">
            <tr><td colspan="4" class="aux_titletable">一级审批</td></tr>
            <tr>
	  			<td colspan="4" class="aux_intable_td1">
            	<div style="overflow:auto; height:100px;" >
					<ec:ceTable items="firstList"
								var="item"
								action=""
								rowsDisplayed="${totalRows }"
								view="pmsNoPageView"
								styleClass="gridData"
							>
						<ec:ceRow styleClass="grid" id="${item.value}"  onclick="setId('${item.value}')" >
							<ec:ceColumn width="50%" property="name" headerCell="pmsHeadrCell"  title="负责人" />
							<ec:ceColumn width="50%"  property="remark" headerCell="pmsHeadrCell"  title="部 门" />
						</ec:ceRow>
					</ec:ceTable>
				</div>
          		</td>
	  		</tr>
			<tr><td colspan="4" class="aux_titletable">二级审批</td></tr>
            <tr>
	  			<td colspan="4" class="aux_intable_td1">
				<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tab_line">
                	<tr>
                    	<td valign="top">
                    	<table width="100%" border="0" cellspacing="0" cellpadding="0" >
                        	<tr>
                                <td colspan="5" >
                                <table width="100%" border="0" cellspacing="0" cellpadding="0" id="crmGrid" class="gridControl gridArea">
                                  <tr >
                                    <td width="44%" class="align_left"  onMouseOver="this.className='grid_sort_on align_left'" onMouseOut="this.className='align_left'"><span class="grid grid_head_line">负责人</span></td>
                                    <td width="50%" class="align_left" onMouseOver="this.className='grid_sort_on align_left'" onMouseOut="this.className='align_left'">部 门</td>
                                  </tr>
                                </table>
                                <table width="100%" border="0" cellspacing="0" cellpadding="0"  class='gridData2'>
                                	<tr class="grid">
                                      <td width="44%" class="grid align_left">
                                      <input id="requisitionId" name="requisitionId" type="hidden" value="${requisitionId}">
                                      <input id="secondId" name="secondId" type="hidden" value="${secondVO.value }">${secondVO.name }</td>
                                      <td width="50%" class="grid align_left">${secondVO.remark }</td>
                                    </tr>
                                </table>
                                </td>
                              </tr>
                          </table>
                          </td>
                    </tr>
            	</table>
            	</td>
	  		</tr>
		</table>
        </td>
      </tr>
    </table>
	</td>
	</tr>

	<tr>
    <td class="window_footer"><table border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td class="buttonOffLeft" id="btn1_21"></td>
              <td class="buttonOffMiddle" id="btn1_22" onClick="sumbitWin();" onMouseOver="btn_change_over(2)" onMouseOut="btn_change_out(2)" onblur="btn_change(2)"><img src="${ctx}/images/ico_submit.gif" alt="" width="14" height="14" border="0" align="absbottom" /> 提 交</td>
              <td class="buttonOffRight" id="btn1_23"></td>
            </tr>
        </table></td>
        <td class="btn_between_space"></td>
        <td><table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td class="buttonOffLeft" id="btn1_31"></td>
              <td class="buttonOffMiddle" id="btn1_32" onClick="windowClose();" onMouseOver="btn_change_over(3)" onMouseOut="btn_change_out(3)" onblur="btn_change(3)"><img src="${ctx}/images/ico_cancel.gif" alt="" width="14" height="14" border="0" align="absbottom" /> 取 消</td>
              <td class="buttonOffRight" id="btn1_33"></td>
            </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>

</body>
</html>